import VueI18n from 'vue-i18n'
import Vue from 'vue'
import customZh from './zh'
import customEn from './en'
import elementEN from 'element-ui/lib/locale/lang/en' // 引入饿了么的英文包
import elementZH from 'element-ui/lib/locale/lang/zh-CN' // 引入饿了么的中文包
import Cookie from 'js-cookie'
Vue.use(VueI18n)

const messages = {
  en: {
    message: {
      hello: 'English'
    },
    ...customEn,
    ...elementEN
  },
  zh: {
    message: {
      hello: '中文'
    },
    ...customZh,
    ...elementZH
  }
}
export const i18n = new VueI18n({
  locale: Cookie.get('language') || 'en',
  messages
})
